package com.wbc.smartHome.web;

import com.wbc.smartHome.model.Commodity;
import com.wbc.smartHome.model.Result;
import com.wbc.smartHome.service.RecommendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;


@RestController
@RequestMapping(path = "/api/recommendCtl")
/*首页推荐*/

@Api(tags = "首页活动推荐模块")
public class  RecommendController {


    @Autowired
    private RecommendService recommendService;

    @ApiOperation("获取推荐的活动、商品、直播的详细信息")
    @ApiResponses({
            @ApiResponse(code = 200 , message = "OK"),
            @ApiResponse(code = 500 , message = "系统异常")
    })
    @GetMapping(path = "getRecommend")
    public Result getRecommendList() {
        ArrayList<Object> arrayList = recommendService.getRecommendList();
        return new Result(200, "OK", arrayList);
    }




}
